package com.kclm.xsap.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.math.BigDecimal;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;


@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
@TableName("t_member_card")
@Accessors(chain = true)
public class MemberCardEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@TableId
	private Long id;

	@NotBlank(message = "会员卡名不能为空")
	private String name;

	@NotNull(message = "卡价格不能为空")
	private BigDecimal price;

	private String description;

	private String note;

	@NotBlank(message = "卡类型不能为空")
	private String type;

	@NotNull(message = "请输入可用次数")
	private Integer totalCount;

	@NotNull(message = "请输入可用天数")
	private Integer totalDay;

	private Integer status;

	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@TableField(fill = FieldFill.INSERT)
	private LocalDateTime createTime;

	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@TableField(fill = FieldFill.INSERT_UPDATE)
	private LocalDateTime lastModifyTime;

	@Version
	private Integer version = 1;


	@TableField(exist = false)
	@ToString.Exclude
	private List<CourseEntity> courseList;


	@TableField(exist = false)
	private LocalDateTime dueTime;



}
